package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

func GetUserDefaultHandler(c *gin.Context) {
	username := c.Query("name")
	c.String(http.StatusOK, fmt.Sprintf("姓名：%s", username))
}

func main() {
	//1.创建路由
	r := gin.Default()
	//2.绑定路由规则
	r.GET("/user/", GetUserDefaultHandler)
	r.Run()
}
